package ar.edu.unicen.exa.isistan.archassis.view;

import java.util.List;

import org.eclipse.swt.widgets.Shell;

import ar.edu.unicen.exa.isistan.archassis.ia.api.db.JavaClass;
import ar.edu.unicen.exa.isistan.archassis.model.persistence.PersistenceManager;
import ar.edu.unicen.exa.isistan.archassis.rcs.IVersion;
import ar.edu.unicen.exa.isistan.archassis.rcs.svn.SVNRevisionControlSystem;
import ar.edu.unicen.exa.isistan.archassis.view.dialogs.GetJavaClassListWorkingDialog;
import ar.edu.unicen.exa.isistan.archassis.view.dialogs.GetVersionsWorkingDialog;

public class LongOperations {

	public static List<IVersion> getVersions(Shell shell, SVNRevisionControlSystem svnRCS) {
		List<IVersion> versionList = PersistenceManager.getCacheVersions(svnRCS);
		if (versionList == null) {
			GetVersionsWorkingDialog d = new GetVersionsWorkingDialog(shell, svnRCS);
			versionList = d.open();
			PersistenceManager.setCacheVersions(svnRCS, versionList);
		}
		return versionList;
	}
	
	public static List<JavaClass> getJavaClassList(Shell shell) {
		GetJavaClassListWorkingDialog d = new GetJavaClassListWorkingDialog(shell);
		return d.open();
	}
	
}
